<template>
  <div>
      <common-head title="添加联系人"/>
      <div class="wrap">
        <van-address-edit
          :area-list="area"
          show-postal
          show-set-default
          :area-columns-placeholder="['请选择', '请选择', '请选择']"
          @save="onSave"
        />
      </div>
  </div>
</template>

<script>
import CommonHead from '../../components/CommonHead.vue'
import area from '@/utils/area'
export default {
   data () {
      return {
        area
      }
    },
  methods: {
    onSave (contact) {
      console.log(contact)
      contact.address = contact.rrovince + contact.city + contact.county + contact.addressDetail
      this.$store.commit('contact/add_contact', contact)
      this.$router.replace('/contactList')
    }
  },
  components: { 
    CommonHead 
    }

}
</script>

<style lang="scss" scoped>
.wrap{
  margin-top: 46px;
  margin-bottom: 50px;
}
</style>